/*
type int
parse '2+3*4' 14
parse '(2+3)*4' 20
parse 3 3
parse '(3)' 3
parse '(((2+3)*4)*(2+3))' 100
*/

Sum <- p:Product "+" s:Sum -> { p + s }
    / Product
Product <- t:Term "*" p:Product -> { t * p }
    / Term
Term <- Decimal / "(" s:Sum ")" -> s
Decimal <- [0-9]+ -> { atoi(ref_str()) }
